<!--
Copyright 2014 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel='import' href='ct-builder-repository.html'>

<script>

var CTBuilderBot;

(function() {

  var BUILDER_URI = 'https://build.chromium.org/p/<group>/builders/<builder>';

  CTBuilderBot = function(group, name, status, lastUpdate) {
    this.group = group;
    this.name = name;
    this.status = status;
    this.lastUpdate = lastUpdate;
    this.repositories = [];
    this.uri = BUILDER_URI.replace('<group>', this.group.name).
      replace('<builder>', this.name);
  };

  CTBuilderBot.prototype.addRepository = function(repository) {
    this.repositories.push(repository);
  };

  CTBuilderBot.prototype.sort = function() {
    this.repositories.sort(CTBuilderRepository.sortFunction);
  };

})();

</script>
